home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / gigo0714.zip / GZIP.DOC < prev    next >
Text File  |  1993-08-18  |  16KB  |  351 lines

  1.  
  2. GZIP(1)                  USER COMMANDS                    GZIP(1)
  3.  
  4. NAME
  5.      gzip, gunzip, zcat - compress or expand files
  6.  
  7. SYNOPSIS
  8.      gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]
  9.      gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
  10.      zcat [ -fhLV ] [ name ... ]
  11.  
  12. DESCRIPTION
  13.      Gzip reduces the size of the named  files  using  Lempel-Ziv
  14.      coding  (LZ77).  Whenever possible, each file is replaced by
  15.      one with the extension .gz, while keeping the same ownership
  16.      modes,  access  and modification times.  (The default exten-
  17.      sion is -gz for VMS, z for MSDOS, OS/2 FAT, Windows  NT  FAT
  18.      and  Atari.) If no files are specified, or if a file name is
  19.      "-", the standard input is compressed to the  standard  out-
  20.      put.   Gzip will only attempt to compress regular files.  In
  21.      particular, it will ignore symbolic links.
  22.  
  23.      If the compressed file name is too long for its file system,
  24.      gzip truncates it.  Gzip attempts to truncate only the parts
  25.      of the file name longer than 3 characters.  (A part is  del-
  26.      imited  by  dots.) If the name consists of small parts only,
  27.      the longest parts are truncated. For example, if file  names
  28.      are  limited  to 14 characters, gzip.msdos.exe is compressed
  29.      to gzi.msd.exe.gz.  Names are not truncated on systems which
  30.      do not have a limit on file name length.
  31.  
  32.      By default, gzip keeps the original file name and  timestamp
  33.      in  the  compressed  file. These are used when decompressing
  34.      the file with  the  -N  option.  This  is  useful  when  the
  35.      compressed  file  name  was truncated or when the time stamp
  36.      was not preserved after a file transfer.
  37.  
  38.      Compressed files can be  restored  to  their  original  form
  39.      using  gzip -d or gunzip or zcat. If the original name saved
  40.      in the compressed file is not suitable for its file  system,
  41.      a  new  name is constructed from the original one to make it
  42.      legal.
  43.  
  44.      gunzip takes a  list  of  files  on  its  command  line  and
  45.      replaces each file whose name ends with .gz, -gz, .z, -z, _z
  46.      or .Z and which begins with the correct magic number with an
  47.      uncompressed  file  without  the original extension.  gunzip
  48.      also recognizes the special  extensions  .tgz  and  .taz  as
  49.      shorthands   for  .tar.gz  and  .tar.Z  respectively.   When
  50.      compressing, gzip  uses  the  .tgz  extension  if  necessary
  51.      instead of truncating a file with a .tar extension.
  52.  
  53.      gunzip can currently decompress files created by gzip,  zip,
  54.      compress,  compress  -H  or pack. The detection of the input
  55.      format is automatic.  When  using  the  first  two  formats,
  56.      gunzip  checks  a  32  bit  CRC. For pack, gunzip checks the
  57.      uncompressed length. The standard compress  format  was  not
  58.      designed  to  allow  consistency  checks.  However gunzip is
  59.      sometimes able to detect a bad .Z file. If you get an  error
  60.      when uncompressing a .Z file, do not assume that the .Z file
  61.      is correct simply because the standard uncompress  does  not
  62.      complain.  This generally means that the standard uncompress
  63.      does not check its input, and happily generates garbage out-
  64.      put.   The  SCO  compress -H format (lzh compression method)
  65.      does not include a CRC  but  also  allows  some  consistency
  66.      checks.
  67.  
  68.      Files created by zip can be uncompressed  by  gzip  only  if
  69.      they  have  a  single member compressed with the 'deflation'
  70.      method. This feature is only intended to help conversion  of
  71.      tar.zip  files  to  the  tar.gz format. To extract zip files
  72.      with several members, use unzip instead of gunzip.
  73.  
  74.      zcat is identical to gunzip -c. (On some systems,  zcat  may
  75.      be  installed  as  gzcat  to  preserve  the original link to
  76.      compress.) zcat uncompresses either a list of files  on  the
  77.      command   line   or   its  standard  input  and  writes  the
  78.      uncompressed data on standard output.  zcat will  uncompress
  79.      files that have the correct magic number whether they have a
  80.      .gz suffix or not.
  81.  
  82.      Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
  83.      The  amount  of  compression obtained depends on the size of
  84.      the input and the distribution of common substrings.   Typi-
  85.      cally,  text  such  as  source code or English is reduced by
  86.      60-70%.  Compression is  generally  much  better  than  that
  87.      achieved  by  LZW  (as used in compress), Huffman coding (as
  88.      used in pack), or adaptive Huffman coding (compact).
  89.  
  90.      Compression is always performed, even if the compressed file
  91.      is  slightly larger than the original. The worst case expan-
  92.      sion is a few bytes for the gzip file header, plus  5  bytes
  93.      every  32K  block, or an expansion ratio of 0.015% for large
  94.      files. Note that the  actual  number  of  used  disk  blocks
  95.      almost  never increases.  gzip preserves the mode, ownership
  96.      and timestamps of files when compressing or decompressing.
  97.  
  98. OPTIONS
  99.      -a --ascii
  100.           Ascii text mode: convert end-of-lines using local  con-
  101.           ventions.  This  option  is supported only on some non-
  102.           Unix systems. For MSDOS, CR LF is converted to LF  when
  103.           compressing,   and  LF  is  converted  to  CR  LF  when
  104.           decompressing.
  105.  
  106.      -c --stdout --to-stdout
  107.           Write output on standard output;  keep  original  files
  108.           unchanged.   If there are several input files, the out-
  109.           put consists of a sequence of independently  compressed
  110.           members.  To obtain better compression, concatenate all
  111.           input files before compressing them.
  112.  
  113.      -d --decompress --uncompress
  114.           Decompress.
  115.  
  116.      -f --force
  117.           Force compression or decompression even if the file has
  118.           multiple   links  or  the  corresponding  file  already
  119.           exists, or if the compressed data is read from or writ-
  120.           ten to a terminal. If the input data is not in a format
  121.           recognized by gzip, and if the option --stdout is  also
  122.           given,  copy the input data without change to the stan-
  123.           dard ouput: let zcat behave as cat. If -f is not given,
  124.           and when not running in the background, gzip prompts to
  125.           verify whether an existing file should be overwritten.
  126.  
  127.      -h --help
  128.           Display a help screen and quit.
  129.  
  130.      -l --list
  131.           For each compressed file, list the following fields:
  132.  
  133.               compressed size: size of the compressed file
  134.               uncompressed size: size of the uncompressed file
  135.               ratio: compression ratio (0.0% if unknown)
  136.               uncompressed_name: name of the uncompressed file
  137.  
  138.           The uncompressed size is given as -1 for files  not  in
  139.           gzip  format,  such  as compressed .Z files. To get the
  140.           uncompressed size for such a file, you can use:
  141.  
  142.               zcat file.Z | wc -c
  143.  
  144.           In combination with the --verbose option, the following
  145.           fields are also displayed:
  146.  
  147.               method: compression method
  148.               crc: the 32-bit CRC of the uncompressed data
  149.               date & time: time stamp for the uncompressed file
  150.  
  151.           The  compression  methods   currently   supported   are
  152.           deflate, compress, lzh (SCO compress -H) and pack.  The
  153.           crc is given as ffffffff for a file not in gzip format.
  154.  
  155.           With --name, the uncompressed name,  date and time  are
  156.           those stored within the compress file if present.
  157.  
  158.           With --verbose, the size totals and  compression  ratio
  159.           for  all files is also displayed, unless some sizes are
  160.           unknown. With --quiet, the title and totals  lines  are
  161.           not displayed.
  162.  
  163.      -L --license
  164.           Display the gzip license and quit.
  165.  
  166.      -n --no-name
  167.           When compressing, do not save the  original  file  name
  168.           and time stamp by default. (The original name is always
  169.           saved  if  the  name  had  to   be   truncated.)   When
  170.           decompressing, do not restore the original file name if
  171.           present  (remove  only  the  gzip   suffix   from   the
  172.           compress